use core::{Package, Target, PackageId, PackageSet};
use util::{CargoResult, CargoError, human};
-use util::{internal, ChainError, Require};
+use util::{internal, ChainError};
use super::job::Work;
use super::{fingerprint, process, Kind, Context, Platform};
// This is also the location where we provide feedback into the build
// state informing what variables were discovered via our script as
// well.
- let output = try!(str::from_utf8(output.output.as_slice()).require(|| {
+ let output = raw_try!(str::from_utf8(output.output.as_slice()).map_err(|_| {
human("build script output was not valid utf-8")
}));
let parsed_output = try!(BuildOutput::parse(output, pkg_name.as_slice()));
Some(ref out) => {
let mut string = String::new();
match str::from_utf8(out.output.as_slice()) {
- Some(s) if s.trim().len() > 0 => {
+ Ok(s) if s.trim().len() > 0 => {
string.push_str("\n--- stdout\n");
string.push_str(s);
}
- Some(..) | None => {}
+ Ok(..) | Err(..) => {}
}
match str::from_utf8(out.error.as_slice()) {
- Some(s) if s.trim().len() > 0 => {
+ Ok(s) if s.trim().len() > 0 => {
string.push_str("\n--- stderr\n");
string.push_str(s);
}
- Some(..) | None => {}
+ Ok(..) | Err(..) => {}
}
Some(string)
},
use std::collections::HashMap;
+
use std::fmt;
use std::io::fs::{mod, PathExtensions};
use std::os;
Some(path) => path,
None => manifest,
};
- let contents = try!(str::from_utf8(contents).require(|| {
+ let contents = raw_try!(str::from_utf8(contents).map_err(|_| {
human(format!("{} is not valid UTF-8", manifest.display()))
}));
let root = try!(parse(contents, &manifest));